<!-- Copyright (c) 2008 by 1eEurope (Switzerland) AG, Thalwil -->

<%@ Page Language="C#" Debug="true" Inherits="System.Web.UI.Page" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<html>
<head runat="server">
    <title>Cache Killer</title>
    <meta http-equiv="content-type" content="text/html" charset="utf-8">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="pragma" content="no-cache">
</head>
<body>

    <script language="CS" runat="server">
        protected override void Render(HtmlTextWriter writer)
        {
            try
            {
                if (SPContext.Current.Web.CurrentUser.IsSiteAdmin)
                {
                    if (!string.IsNullOrEmpty(this.Page.Request.QueryString["key"]))
                    {
                        HttpContext.Current.Cache.Remove(this.Page.Request.QueryString["key"]);
                        writer.Write("Cache entry killed");
                    }
                }
            }
            catch (Exception) { }
        }
        
        
    </script>

    
</body>
</html>
